/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package keshe;
import java.awt.GridLayout;
import java.awt.event.*;

import javax.swing.*;

public class StudentEdit extends JFrame{

    JPanel p1=new JPanel();
    JPanel p2=new JPanel();
    JPanel p3=new JPanel();
    JPanel p4=new JPanel();
    JPanel p5=new JPanel();
    JPanel p6=new JPanel();
    JPanel p7=new JPanel();
    JPanel p8=new JPanel();
    JPanel p9=new JPanel();
    JPanel p10=new JPanel();
    JPanel p11=new JPanel();
    JPanel p12=new JPanel();

    JLabel la1=new JLabel("学号");
    JLabel la2=new JLabel("姓名");
    JLabel la3=new JLabel("性别");
    JLabel la4=new JLabel("生日");
    JLabel la5=new JLabel("年级");
    JLabel la6=new JLabel("班别");
    JLabel la7=new JLabel("语文");
    JLabel la8=new JLabel("英语");
    JLabel la9=new JLabel("数学");
    JLabel la10=new JLabel("专业");

    JButton b1=new JButton("确定");
    JButton b2=new JButton("取消");

    JTextField num=new JTextField(10);
    JTextField name=new JTextField(10);
    JTextField chinese=new JTextField(10);
    JTextField english=new JTextField(10);
    JTextField maths=new JTextField(10);
    JTextField birth=new JTextField(10);

    String[] sex={"","男","女"};
    JComboBox s=new JComboBox(sex);
    String[] grades={"","2018","2019","2020","2021"};
    JComboBox grade=new JComboBox(grades);
    String[] classes={"","1","2","3","4"};
    JComboBox clas=new JComboBox(classes);
    String[] majors={"","网络工程","通信工程","软件工程","计算机科学与技术","电子信息工程"};
    JComboBox major=new JComboBox(majors);

    public StudentEdit(){
        p1.add(la1);
        p1.add(num);

        p2.add(la2);
        p2.add(name);

        p3.add(la3);
        p3.add(s);

        p4.add(la4);
        p4.add(birth);

        p5.add(la5);
        p5.add(grade);

        p6.add(la6);
        p6.add(clas);

        p7.add(la7);
        p7.add(chinese);

        p8.add(la8);
        p8.add(english);

        p9.add(la9);
        p9.add(maths);

        p10.add(la10);
        p10.add(major);

        p11.add(b1);
        p11.add(b2);
        //设计布局
        getContentPane().setLayout(new GridLayout(6,2));
        getContentPane().add(p1);
        getContentPane().add(p2);
        getContentPane().add(p3);
        getContentPane().add(p4);
        getContentPane().add(p5);
        getContentPane().add(p6);
        getContentPane().add(p7);
        getContentPane().add(p8);
        getContentPane().add(p9);
        getContentPane().add(p10);
        getContentPane().add(p11);
        getContentPane().add(p12);

        setBounds(500, 250, 100, 100);
        pack();
        setVisible(true);

    }
}

